package main

import (
	"flag"
	"fmt"

	jrpc "orchestrator/internal/infra/jsonrpc"
	{{.imports}}

	"github.com/zeromicro/go-zero/core/stores/sqlx"
)

func main() {

	var (
		host     string
		port     int
		username string
		password string
		database string
	)

	flag.StringVar(&host, "host", "oms-middleware-mysql", "MySQL host")
	flag.IntVar(&port, "port", 3306, "MySQL port")
	flag.StringVar(&username, "username", "root", "MySQL username")
	flag.StringVar(&password, "password", "ws-123456", "MySQL password")
	flag.StringVar(&database, "database", "isar", "MySQL database")
	flag.Parse()

	dsn := fmt.Sprintf("%s:%s@tcp(%s:%d)/%s?charset=utf8mb4&parseTime=True&loc=Local", username, password, host, port, database)
	conn := sqlx.NewMysql(dsn)
	
	{{.registers}}
	jrpc.Start()
}
